<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>

 <%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
        <link rel="stylesheet" href="<%=basePath %>/css/list.css">
		<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
		<script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
		<script src="<%=basePath %>/js/jquery.min.js"></script>
		<script src="<%=basePath %>/js/formsJS.js"></script>
		

		
<script type="text/javascript">

function checkForm(f){

	
	if(f.goodsId.value.replace(/\s/g,'') == ''){
		alert("商品不能为空");
		return false;
	}
	
//	if(f.paramName.value.replace(/\s/g,'') == ''){
//		alert("参数名称不能为空");
//		return false;
//	}
//	if(f.showFlag.value.replace(/\s/g,'') == ''){
	//	alert("是否展示不能为空");
	//	return false;
//	}
//	if('${type}'=='add'){
//		if(f.paramImg.value.replace(/\s/g,'') == ''){
//			alert("规格图片不能为空");
//			return false;
//		}
//	}
	
 
	return true;
}
	

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">商品参数维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/goodsParam/goodsParamEdit" method="post" onsubmit="return checkForm(this)"
					enctype="multipart/form-data" >
					<div class="col-sm-4"></div>
	    					<div class="col-sm-4">
	    							<div class="boxs">
												<input type="hidden" name="id" value="${goodsParam.id}"><br />
												
												<select class="selectBox" name="goodsId" id="goodsId">
								    				<option value="">----选择商品----</option>
									    			<c:forEach items="${goods}" var="g">
									    				<option value="${g.id}" ${g.id == goodsParam.goodsId ? 'selected="selected"' : ''}>${g.id}:${g.goodsName}</option>
									    			</c:forEach>
					    						</select>
											<%-- 	<select id="showFlag" name="showFlag" class="selectBox"  >
												  	<option value="">是否展示</option>
										  			<option value="0" ${goodsParam.showFlag == 0 ? 'selected="selected"' : '' }>否</option>
										  			<option value="1" ${goodsParam.showFlag == 1 ? 'selected="selected"' : '' }>是</option>
												</select> --%>
											<%-- 	<input type="text" class="inputBox" placeholder="参数名称" name="paramName" value="${goodsParam.paramName}" > --%>
												
											<%-- 	 <textarea  id="paramValue" placeholder="参数取值" name="paramValue" class="inputBox kindeditor" style="width: 90%;">${goodsParam.paramValue}</textarea> --%>
												 
												<input type="text" class="inputBox" placeholder="规格取值" name="paramValue" value="${goodsParam.paramValue}" >
											
											 	<input type="file" class="inputBox" placeholder="规格图片" name="imgFile"  value="${goodsParam.paramImg}" ><br /><br />
 												
												<input type="number" class="inputBox" placeholder="规格库存" name="specInventory" value="${goodsParam.specInventory}" >
												
												<br /><br />
												<input type="submit" value="确定" class="true" />
												<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
										</div>
								</div>
					</form>
			</div>
	</div>
	
</body>

	 
</html>